package com.parent.child;


public class TestDemo implements IAnimalable {
	public static void main(String[] args) {
		new TestDemo().onCreate();
	}
	void  onCreate(){
		final Sepecific sepecific = new Sepecific();
//		sepecific.eat(TestDemo.this);
		sepecific.eat(new IAnimalable() {
			
			@Override
			public void init() {
				System.out.println("innerclass");
				sepecific.setResult("set result ");
				System.err.println(sepecific.getResult());
				
			}
			
			@Override
			public void doWork() {
				
			}
			
			@Override
			public void close() {
				
			}
		});
	}

	@Override
	public void init() {
		System.out.println("TestDemo init");
		
	}

	@Override
	public void doWork() {
		System.out.println("TestDemo doWork");
	}

	@Override
	public void close() {
		System.out.println("TestDemo close");
	}



}
